/*
Date:20220130 11:50
key:map[key]=vale
*/
class Solution {
public:
    unordered_map<string,int>Cut(string sentence,char c)
    {
        //vector<string>str_V;
        unordered_map<string,int>m;
        string tmp="";
        for(int i=0;i<sentence.size();i++)
        {
            if(sentence[i]==c)
            {
                if(tmp!="")//避免连续 分割字符 情况
                {
                        if(m.count(tmp)==0)
                        {
                            m[tmp]=1;
                        }else
                        {
                            m[tmp]++;
                        }
                }
            
            tmp="";continue;}
            else
            {
                tmp=tmp+sentence[i];
            }
        }
        if(m.count(tmp)==0)
        {
            m[tmp]=1;
        }else
        {
            m[tmp]++;
        }
        //str_V.push_back(tmp);
        return m;
    }
    vector<string> uncommonFromSentences(string s1, string s2) {
        unordered_map<string,int>m1,m2;
        vector<string>result;
        m1=Cut(s1,' ');
        m2=Cut(s2,' ');
        for(auto t:m1)
        {
            if(t.second==1&&m2.count(t.first)==0)
            {
                result.push_back(t.first);
            }
            //cout<<t.first<<" "<<t.second;
        }
        for(auto t:m2)
        {
            if(t.second==1&&m1.count(t.first)==0)
            {
                result.push_back(t.first);
            }
            //cout<<t.first<<" "<<t.second;
        }
        return result;
    }
};